package concurrent;

import java.util.Comparator;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author 26029
 * @date 2025/4/25
 * @description
 */
public class LearnLock {
    public static void main(String[] args) {
        Lock lock = new ReentrantLock();
        int[] a = new int[2];
        try {
            System.out.println(a[2]);
            lock.lock();
        } catch (Exception e) {
            System.out.println("got exception");
            lock.unlock();
        }
    }
}
